package net.dreamlu.qa.validator;

import net.dreamlu.qa.model.User;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

public class ForgotValidator extends Validator {
	
	protected void validate(Controller controller) {
		setShortCircuit(true);
		validateEmail("mail", "errorMail", "1");
	}
	
	protected void handleError(Controller controller) {
		controller.keepModel(User.class);
		controller.render("/account/forgot.jsp");
	}
}